From b05c476cf6595bbdc7017e9c2a683fdd5cf72117 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 31 Aug 2009 09:47:30 +0100 Subject: [PATCH] x86: fix get_free_pirq GSI should not be allocated for other purpose, so change the hard code limit. Also fix the out of loop checking, it should be '<' instead of '=='. Signed-off-by: Qing He --- xen/arch/x86/irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 1f5e1a666d..1e2fa8b147 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1254,10 +1254,10 @@ int get_free_pirq(struct domain *d, int type, int index) } else { - for ( i = d->nr_pirqs - 1; i >= 16; i-- ) + for ( i = d->nr_pirqs - 1; i >= nr_irqs_gsi; i-- ) if ( !d->arch.pirq_irq[i] ) break; - if ( i == 16 ) + if ( i < nr_irqs_gsi ) return -ENOSPC; } -- 2.30.2